package com.hnkywl.sts.util;
import net.ruixin.orm.hibernate.Page;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 12-11-2
 * Time: 下午9:57
 * To change this template use File | Settings | File Templates.
 */
public class Pager {
    private int pageNum;
    private int numPerPage;
    private int total;

    public static Pager initPager(int pageNum,int numPerPage) {
        return Pager.initPager(pageNum,numPerPage,-1);
    }

    public static Pager initPager(int pageNum,int numPerPage,int total) {
        Pager pager = new Pager();
        pager.pageNum = pageNum;
        pager.numPerPage = numPerPage;
        pager.total = total;
        return pager;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getNumPerPage() {
        return numPerPage;
    }

    public void setNumPerPage(int numPerPage) {
        this.numPerPage = numPerPage;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public Page getPage() {
        return new Page(this.getPageNum(),this.getNumPerPage(),this.getTotal());
    }
}
